package com.example.mydianping.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mydianping.pojo.VoucherOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.management.MXBean;

@Mapper
public interface VoucherOrderMapper extends BaseMapper<VoucherOrder> {

    @Select("select count(*) from tb_voucher_order where user_id = #{id} and voucher_id = #{voucherId}")
    int overBuy(@Param("id") Long id,@Param("voucherId") Long voucherId);

}
